package com.tencet.dao.impl;

import com.tencet.dao.EarnDao;
import com.tencet.entity.Earn;
import com.tencet.utils.JDBCUtils;
import org.apache.commons.dbutils.QueryRunner;

import java.sql.SQLException;
import java.util.List;

public class EarnDaoImpl implements EarnDao {
    @Override
    public List earnList(Earn earn) {

        return null;
    }

    @Override
    public int addList(Earn earn) {
        QueryRunner queryRunner = new QueryRunner(JDBCUtils.getDataSource());

        String sql = "insert into earn values(null,?,null)";
        try {
            int i = queryRunner.update(sql,earn.getE_num());
            return i;
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }
}
